local Lighting = game:GetService("Lighting")

local ClientOHOH = _G.ClientOHOH;
local M = ClientOHOH.class.new(script, ClientOHOH.files.BaseComponent());

local SkyFolder=Instance.new("Folder",workspace)
SkyFolder.Name="defaultSky"

function M.new(self,...)
	return M(self,...);
end;

function M.ctor(self, parent)
	M.super.ctor(self, parent);

    self.isDefaultSky=true;
    self:AddProcess(function()
        -- task.wait(0.5)
        for _,v in pairs(Lighting:GetChildren()) do
            v:Clone().Parent=SkyFolder
        end
    end)

end;


function M.SetSky(self,skyFolder)
    for _,v in pairs(Lighting:GetChildren()) do
        v:Destroy()
    end
    for _,v in pairs(skyFolder:GetChildren()) do
        v.Parent=Lighting
    end
    skyFolder:Destroy()
    self.isDefaultSky=false
end

function M.SetDefaultSky(self)
    if  self.isDefaultSky then
        return 
    end
    self.isDefaultSky=true;
    self:SetSky(SkyFolder:Clone())
end



function M.dtor(self)

end

return M